<%-- 
    Document   : index
    Created on : Feb 8, 2012, 3:39:25 PM
    Author     : haohao
--%>

<%@page import="java.util.List"%>
<%@page import="entity.Book"%>
<%@page import="dal.DBConnection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table border="1" bgcolor="lavender">
            <%
                        DBConnection dal = new DBConnection();
                        List<Book> list = dal.getAll();
                        for (Book p : list) {
            %>
            <tr>
                <td> <%= p.getId()%> </td>
                <td> <%=p.getName()%> </td>
                <td> <%= p.getAuthor()%> </td>
                <td> <%= p.getPublisher()%> </td>
                <td> <%= p.getDescription()%> </td>
                <td> <%= p.getYear()%> </td>
                <td><a href="Manager?id=<%= p.getId()%>"> Dat hang </a></td>
            </tr>
            <%}
            %>
        </table>
    </body>
</html>
